package com.wxyzz.canteenadmin.order.orderSettlement.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxyzz.canteenadmin.order.orderSettlement.mapper.OrderSettlementMapper;
import com.wxyzz.canteenadmin.order.orderSettlement.param.OrderSettlementParam;
import com.wxyzz.canteenadmin.order.orderSettlement.service.OrderSettlementService;
import com.wxyzz.canteenadmin.order.orderSettlement.vo.OrderSettlementVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderSettlementServiceImpl implements OrderSettlementService {
    @Resource
    private OrderSettlementMapper orderSettlementMapper;

    @Override
    public PageInfo<OrderSettlementVo> getOrderSettlement(OrderSettlementParam orderSettlementParam) {
        PageHelper.startPage(orderSettlementParam.getPageNum(),orderSettlementParam.getPageSize());
        List<OrderSettlementVo> orderSettlementVos = orderSettlementMapper.selectOrderSettlement(
                orderSettlementParam.getOrderNumber());
        PageInfo<OrderSettlementVo> orderSettlementVoPageInfo = new PageInfo<>(orderSettlementVos);
        return orderSettlementVoPageInfo;
    }
}
